<?php defined('SYSPATH') or die('No direct script access.');
/**
 * 扩展并重写 Config 类
 *
 * @author  Yellow.Chow <aultoale@gmail.com>
 * @version $Id: config.php 296 2012-07-06 02:39:42Z yellow.chow $
 * @license http://www.gnu.org/licenses/gpl-3.0.html    GPL 3
 */
class Config extends Kohana_Config
{

    /**
     * 类似 Config::load($group) 方法
     *
     * @param   string  configuration group name
     * @return  object  Kohana_Config_Group
     */
    public static function get($group, $default = NULL)
    {
        $data = Kohana::$config->load($group);

        return ($data === NULL) ? $default : $data;
    }

    /**
     * 写入配置数据，专为数据库配置提供
     *
     * @param  string  $group
     * @param  string  $key
     * @param  mixed   $value
     * @return Kohana_Config
     */
    public static function set($group, $key, $value)
    {
        return Kohana::$config->_write_config($group, $key, $value);
    }

}